package pers.cj.pdos.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import pers.cj.pdos.entity.PerformanceAnalysis;
import pers.cj.pdos.entity.ProfitsReport;
import pers.cj.pdos.entity.SaleAnalysis;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author chenj
 * @since 2020-03-25
 */
public interface PerformanceAnalysisMapper extends BaseMapper<PerformanceAnalysis> {

    Map getTotalData(@Param("companyId")String companyId,
                     @Param("storeId")String storeId,
                     @Param("date1") Date date1,
                     @Param("date2")Date date2);


    Map getHighSaleUser(@Param("companyId")String companyId,
                      @Param("storeId")String storeId,
                      @Param("date1") Date date1,
                      @Param("date2")Date date2);

    List<PerformanceAnalysis> listUserData(@Param("companyId")String companyId,
                                           @Param("page") Integer page,
                                           @Param("limit") Integer limit,
                                           @Param("storeId")String storeId,
                                           @Param("date1") Date date1,
                                           @Param("date2")Date date2,
                                           @Param("filterZero")Boolean filterZero,
                                           @Param("search")String search,
                                           @Param("userStoreId")String userStoreId);

    Long countUserData(@Param("companyId")String companyId,
                       @Param("storeId")String storeId,
                       @Param("date1") Date date1,
                       @Param("date2")Date date2,
                       @Param("filterZero")Boolean filterZero,
                       @Param("search")String search,
                       @Param("userStoreId")String userStoreId);

    BigDecimal getUserTotal(@Param("companyId")String companyId,
                              @Param("storeId")String storeId,
                              @Param("date1") Date date1,
                              @Param("date2")Date date2,
                              @Param("filterZero")Boolean filterZero,
                              @Param("search")String search);

    List<PerformanceAnalysis> listDetailByOrder(@Param("companyId")String companyId,
                                            @Param("page") Integer page,
                                            @Param("limit") Integer limit,
                                            @Param("userId")String userId,
                                            @Param("storeId")String storeId,
                                            @Param("date1") Date date1,
                                            @Param("date2")Date date2,
                                            @Param("search")String search);

    Long countDetailByOrder(@Param("companyId")String companyId,
                        @Param("userId")String userId,
                        @Param("storeId")String storeId,
                        @Param("date1") Date date1,
                        @Param("date2")Date date2,
                        @Param("search")String search);

    List<PerformanceAnalysis> listDetailByGoods(@Param("companyId")String companyId,
                                                @Param("page") Integer page,
                                                @Param("limit") Integer limit,
                                                @Param("userId")String userId,
                                                @Param("storeId")String storeId,
                                                @Param("date1") Date date1,
                                                @Param("date2")Date date2,
                                                @Param("search")String search);

    Long countDetailByGoods(@Param("companyId")String companyId,
                            @Param("userId")String userId,
                            @Param("storeId")String storeId,
                            @Param("date1") Date date1,
                            @Param("date2")Date date2,
                            @Param("search")String search);
}
